<?php $this->load->view('common/header');?>
<script>
    function upload1(){
        $("#upimg1").click();
    }
    function sm1(){
        $("#upfile1").submit();
    }
    function upload2(){
        $("#upimg2").click();
    }
    function sm2(){
        $("#upfile2").submit();
    }
    function upload3(){
        $("#upimg3").click();
    }
    function sm3(){
        $("#upfile3").submit();
    }
    function upload4(){
        $("#upimg4").click();
    }
    function sm4(){
        $("#upfile4").submit();
    }
</script>
<body class="padding_top">
<!-- head [[-->
<div class="head_box">
	<div class="bank_nav">
        <a href="<?php echo site_url('member');?>"><i class="ico"></i></a>
    </div>
    <div class="head_title">实名认证</div>
</div>
<!--]] head -->
<!-- info [[-->
<div class="certified_form">
	<dl>
    	<dt>真实姓名</dt>
        <dd>
        	<span class="input">
            	<input placeholder="请输入您的真实姓名">
            </span>
        </dd>
    </dl>
	<dl>
    	<dt>身份证号</dt>
        <dd>
        	<span class="input">
            	<input placeholder="请输入真实有效身份证号码">
            </span>
        </dd>
    </dl>
	<dl>
    	<dt>上传证件</dt>
        <dd>
            <form action="<?php echo site_url('member/certified_img') ?>" method="post" id="upfile1" enctype="multipart/form-data">
                <span class="upload">
                    <?php if(isset($authority['card1']) && !empty($authority['card1'])){ ?>
                        <input type="file" class="posi_opacity" id="upimg1" name="card1" onchange="sm1();" style="display:none">
                        <em style="display:none;">上传<br>公账流水</em>
                        <img src="<?php echo $authority['card1'];?>" onclick="upload1();">
                    <?php }else{ ?>
                        <input type="file" id="upimg1" name="card1" onchange="sm1();">
                        <em>上传<br>公账流水</em>
                    <?php } ?>
                </span>
            </form>
            <form action="<?php echo site_url('member/certified_img') ?>" method="post" id="upfile2" enctype="multipart/form-data">
                <span class="upload">
                    <?php if(isset($authority['card2']) && !empty($authority['card2'])){ ?>
                        <input type="file" class="posi_opacity" id="upimg2" name="card2" onchange="sm2();" style="display:none">
                        <em style="display:none;">上传<br>公账流水</em>
                        <img src="<?php echo $authority['card2'];?>" onclick="upload2();">
                    <?php }else{ ?>
                        <input type="file" id="upimg2" name="card2" onchange="sm2();">
                        <em>上传<br>公账流水</em>
                    <?php } ?>
                </span>
            </form>
        </dd>
    </dl>
	<dl>
    	<dt>个人征信</dt>
        <dd>
            <form action="<?php echo site_url('member/certified_img') ?>" method="post" id="upfile3" enctype="multipart/form-data">
                <span class="upload">
                    <?php if(isset($authority['bill1']) && !empty($authority['bill1'])){ ?>
                        <input type="file" class="posi_opacity" id="upimg3" name="bill1" onchange="sm3();" style="display:none">
                        <em style="display:none;">上传<br>公账流水</em>
                        <img src="<?php echo $authority['bill1'];?>" onclick="upload3();">
                    <?php }else{ ?>
                        <input type="file" id="upimg3" name="bill1" onchange="sm3();">
                        <em>上传<br>公账流水</em>
                    <?php } ?>
                </span>
            </form>
            <form action="<?php echo site_url('member/certified_img') ?>" method="post" id="upfile4" enctype="multipart/form-data">
                <span class="upload">
                    <?php if(isset($authority['bill2']) && !empty($authority['bill2'])){ ?>
                        <input type="file" class="posi_opacity" id="upimg4" name="bill2" onchange="sm4();" style="display:none">
                        <em style="display:none;">上传<br>公账流水</em>
                        <img src="<?php echo $authority['bill2'];?>" onclick="upload4();">
                    <?php }else{ ?>
                        <input type="file" id="upimg4" name="bill2" onchange="sm4();">
                        <em>上传<br>公账流水</em>
                    <?php } ?>
                </span>
            </form>
        </dd>
    </dl>
	<dl class="sure_nav">
    	<a href="javascript:;" id="do_sub">
            <input type="submit">
            提交认证
        </a>
    </dl>
</div>
<script type="text/javascript">

    // 提交
    $("#do_sub").on("click",function(){
        var URL= baseurl+"index.php/member/sub_certified";
        $.ajax({
            type: "post",
            url: URL,
            dataType:'json',
            data: {
                'is_submit':1,
                'csrf_test_name': ci_csrf_token()
            },
            success: function(data){
                if(data.code == 200){
                    layer.msg('提交成功', {
                        time: 1000, //1s后自动关闭
                        shade: 0.1
                    },function () {
                        window.location.href = baseurl+"index.php/member";
                    });
                }else{
                    layer.msg(data.msg);
                    return false;
                }

            }
        });
    });
</script>
<!--]] info -->
</body>
</html>
